import user from "./modules/user";

const getters = {
    token:state=> state.user.token,
    username:state=> state.user.username,
    userId:state=> state.user.userId,
    nickname:state=> state.user.nickname,
    headImgUrl:state=> state.user.headImgUrl,
    chartChange:state=> state.charts.chartChange,
    getChartMapValues:state=> ()=>Object.values(state.charts.chartMap).sort((a,b)=>{return b.lastMsgTime < a.lastMsgTime ? -1 : 1}),
    getChartMapSize:state=> ()=>Object.values(state.charts.chartMap).length,
    getChartMapByChartUserId:state=> (chartUserId)=>state.charts.chartMap[chartUserId],
}
export default getters